<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="../style.css" type="text/css" media="all" />
<body>
<h1>DBController</h1>
<div class="class_description">Предоставляет интерфейс к базе данных</div>
<h2>Методы</h2><ul><li><a href="#fetch_array">fetch_array</a></li><li><a href="#fetch_row">fetch_row</a></li><li><a href="#getCountQueries">getCountQueries</a></li><li><a href="#getInstance">getInstance</a></li><li><a href="#loadEngine">loadEngine</a></li><li><a href="#num_rows">num_rows</a></li><li><a href="#query">query</a></li><li><a href="#reset_pointer">reset_pointer</a></li><li><a href="#startTransaction">startTransaction</a></li><li><a href="#stopTransaction">stopTransaction</a></li></ul><a name="fetch_array"></a>
<h3>fetch_array</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">array</span> <span class="name">fetch_array</span> (<span class="type">resourse</span> <span class="varname">$resourse</span>)</div><p>Аналог функции mysql_fetch_array</p>
</div>
</div><a name="fetch_row"></a>
<h3>fetch_row</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">array</span> <span class="name">fetch_row</span> (<span class="type">resourse</span> <span class="varname">$resourse</span>)</div><p>Аналог функции mysql_fetch_row</p>
</div>
</div><a name="getCountQueries"></a>
<h3>getCountQueries</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="static">static</span> <span class="return">integer</span> <span class="name">getCountQueries</span> ()</div><p>Возвращает количество выполненных запросов к БД</p>
</div>
</div><a name="getInstance"></a>
<h3>getInstance</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="static">static</span> <span class="return">DBController</span> <span class="name">getInstance</span> ()</div><p>Возвращает объект класса DBController</p>
</div>
</div><a name="loadEngine"></a>
<h3>loadEngine</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">void</span> <span class="name">loadEngine</span> (<span class="type">string</span> <span class="varname">$engineName</span>)</div><p>Загружает движок, реализующий интерфейс к базе данных</p>
</div>
</div><a name="num_rows"></a>
<h3>num_rows</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">integer</span> <span class="name">num_rows</span> (<span class="type">resourse</span> <span class="varname">$resourse</span>)</div><p>Аналог функции mysql_num_rows</p>
</div>
</div><a name="query"></a>
<h3>query</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">resource</span> <span class="name">query</span> (<span class="type">string</span> <span class="varname">$sQuery</span>, <span class="type">integer</span> <span class="varname">$insertId</span> = 0)</div><p>Выполнить запрос к базе данных</p>
</div>
</div><div class="block parametrs">
<h4>Параметры</h4>
<div class="text parametrs"><dl class="var_description">
	<dt>sQuery</dt>
	<dd>строка с запросом</dd>
</dl><dl class="var_description">
	<dt>insertId</dt>
	<dd>ссылка на переменную, которой будет присвоен идентификатор вставленной записи</dd>
</dl>
</div>
</div><a name="reset_pointer"></a>
<h3>reset_pointer</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">void</span> <span class="name">reset_pointer</span> (<span class="type">resourse</span> <span class="varname">$resourse</span>, <span class="type">integer</span> <span class="varname">$position</span> = 0)</div><p>Аналог функции mysql_data_seek</p>
</div>
</div><a name="startTransaction"></a>
<h3>startTransaction</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">void</span> <span class="name">startTransaction</span> ()</div><p>Начинает транзакцию</p>
</div>
</div><a name="stopTransaction"></a>
<h3>stopTransaction</h3>
<div class="block description">
<h4>Описание</h4>
<div class="text method_description">
<div class="prototype"><span class="return">void</span> <span class="name">stopTransaction</span> ()</div><p>Завершает транзакию</p>
</div>
</div><h2>Примеры</h2><div class="sample">
<p>Пример №1</p>
<div class="sample_content"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$db&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">DBController</span><span style="color: #007700">::</span><span style="color: #0000BB">getInstance&nbsp;</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">startTransaction&nbsp;</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">query&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"DUPLICATE&nbsp;`sometable`"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">query&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">"DUPLICATE&nbsp;`other&nbsp;table`"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$db</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">stopTransaction&nbsp;</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
</div></body>
</html>